package cn.dakaqi.entities;

import cn.dakaqi.entities.user.Volunteer;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by chunyang on 2016/4/18.
 * 活动招募报名名单
 */

@Entity
@Table(name = "U_ACTIVITY_RECRUIT_VOLUNTEER")
public class ActivityRecruitVolunteer extends IdEntity
{

    private static final long serialVersionUID = 6332328984892244857L;
    ActivityRecruit activityRecruit;
    Volunteer volunteer;
    int status;
    Date createTime;
    private String question;    //问题
    private String answer;      //答案
    private String refuseCase;      //拒绝理由

    public String getRefuseCase()
    {
        return refuseCase;
    }

    public void setRefuseCase(String refuseCase)
    {
        this.refuseCase = refuseCase;
    }

    @OneToOne
    @JoinColumn(name = "ACTIVITY_RECRUIT_ID")
    @JsonIgnore
    public ActivityRecruit getActivityRecruit()
    {
        return activityRecruit;
    }

    public void setActivityRecruit(ActivityRecruit activityRecruit)
    {
        this.activityRecruit = activityRecruit;
    }
    @OneToOne
    @JoinColumn(name = "VOLUNTEER_ID")
    @JsonIgnore
    public Volunteer getVolunteer()
    {
        return volunteer;
    }

    public void setVolunteer(Volunteer volunteer)
    {
        this.volunteer = volunteer;
    }

    public int getStatus()
    {
        return status;
    }

    public void setStatus(int status)
    {
        this.status = status;
    }

    public String getQuestion()
    {
        return question;
    }

    public void setQuestion(String question)
    {
        this.question = question;
    }

    public String getAnswer()
    {
        return answer;
    }

    public void setAnswer(String answer)
    {
        this.answer = answer;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime()
    {
        return createTime;
    }

    public void setCreateTime(Date createTime)
    {
        this.createTime = createTime;
    }
}
